export type KeyName = 'detail' | 'instances' | 'characters' | 'hireRoles' | 'items' | 'shopItems'

export default class {
  instances: any = [] // 副本数据
  characters: any = [] // 持有角色数据
  hireRoles: any = [] // 雇佣商店数据
  items: any = [] // 持有物品数据
  shopItems: any = [] // 商店物品数据
  detail = {} // 详情信息

  setData(data: any) {
    const keys: Array<KeyName> = [
      'detail',
      'instances',
      'characters',
      'hireRoles',
      'items',
      'shopItems'
    ]
    keys.forEach((key: KeyName) => {
      if (Object.prototype.hasOwnProperty.call(data, key)) {
        this[key] = data[key]
      }
    })
  }
}
